﻿<%@ Page Language="VB" MasterPageFile="~/PubRankingMaster.master" AutoEventWireup="false"
  CodeFile="PubRnkVisualizarRanking.aspx.vb" Inherits="ranking_PubRnkVisualizarRanking" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
  <asp:ScriptManager ID="ScriptManager1" runat="server">
  </asp:ScriptManager>
  <table style="width: 100%; font-family: Arial, Helvetica, sans-serif; font-size: x-small;">
    <tr>
      <td style="width: 7px">
        &nbsp;
      </td>
      <td colspan="2">
        <p class="titulo-pagina" style="text-align: left">
          Rankings de Vendas</p>
      </td>
    </tr>
    <tr>
      <td style="width: 7px">
        &nbsp;
      </td>
      <td colspan="2">
        &nbsp;
      </td>
    </tr>
    <tr>
      <td style="width: 7px">
        &nbsp;
      </td>
      <td colspan="2" class="texto-basico">
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Bem-vindo a seção dos rankings dos vendedores
        fit4. Aqui além de você conseguir conferir sua posição no ranking de venda de produtos
        pode visualizar seu colegas e se comparar com as metas alcançadas, troque mensagens
        no ranking para aumentar sua experiência ou desafiar seus colegas.
      </td>
    </tr>
    <tr>
      <td style="width: 7px">
        &nbsp;
      </td>
      <td colspan="2" style="text-align: left">
        <asp:GridView ID="grvRankings" runat="server" AutoGenerateColumns="False" SkinID="grvEventos"
          Caption="RANKINGS" DataKeyNames="IdRanking" Width="637px">
          <Columns>
            <asp:BoundField DataField="Nome" HeaderText="Nome">
              <HeaderStyle HorizontalAlign="Center" />
              <ItemStyle HorizontalAlign="Left" Width="150px" />
            </asp:BoundField>
            <asp:BoundField DataField="Produto" HeaderText="Produto">
              <ItemStyle Width="60px" />
            </asp:BoundField>
            <asp:BoundField DataField="Premio" HeaderText="Prêmio">
              <ItemStyle Width="140px" />
            </asp:BoundField>
            <asp:BoundField DataField="Inicio" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Início">
              <HeaderStyle HorizontalAlign="Center" />
              <ItemStyle HorizontalAlign="Center" Width="50px" />
            </asp:BoundField>
            <asp:BoundField DataField="Fim" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Fim">
              <HeaderStyle HorizontalAlign="Center" />
              <ItemStyle HorizontalAlign="Center" Width="50px" />
            </asp:BoundField>
            <asp:TemplateField>
              <EditItemTemplate>
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
              </EditItemTemplate>
              <ItemTemplate>
                <asp:ImageButton ID="ImageButton1" runat="server" CommandName="Select" ImageUrl="~/imagens/btnSelecionarIcone.gif" />
              </ItemTemplate>
              <ItemStyle Width="55px" />
            </asp:TemplateField>
          </Columns>
        </asp:GridView>
      </td>
    </tr>
    <tr>
      <td style="width: 7px">
        &nbsp;
      </td>
      <td colspan="2">
        &nbsp;
      </td>
    </tr>
    <tr>
      <td style="width: 7px; text-align: left;">
      </td>
      <td colspan="2" style="text-align: left">
        <table style="width: 637px">
          <tr style="background-color: #DD4814">
            <td style="width: 85px; color: #FFFFFF; font-size: small;">
              <b>Pos.</b>
            </td>
            <td style="width: 240px; color: #FFFFFF; font-size: small;" __designer:mapid="b0">
              <b __designer:mapid="b1">Vendedor</b>
            </td>
            <td style="width: 180px; color: #FFFFFF; font-size: small;" __designer:mapid="b2">
              <b __designer:mapid="b3">Franquia</b>
            </td>
            <td style="width: 107px; color: #FFFFFF; font-size: small;" __designer:mapid="b4">
              <b __designer:mapid="b5">Pontos</b>
            </td>
          </tr>
        </table>
        <table width="631px">
          <tr>
            <td style="text-align: left">
              <cc1:Accordion ID="accRanking" runat="server" BorderColor="ActiveBorder" ContentCssClass="divBranco"
                FadeTransitions="true" HeaderCssClass="divBranco" HeaderSelectedCssClass="divCinza">
                <HeaderTemplate>
                  <table width="631px">
                    <tr>
                      <td style="width: 85px; text-align: center;">
                        <asp:Label ID="lblPos" SkinID="lblPosRanking" Visible="False" runat="server" />
                        <asp:Image ID="imgBronze" runat="server" ImageUrl="~/imagens/medalha-bronze.jpg"
                          Visible="False" />
                        <asp:Image ID="imgPrata" runat="server" ImageUrl="~/imagens/medalha-prata.jpg" Visible="False" />
                        <asp:Image ID="imgOuro" runat="server" ImageUrl="~/imagens/medalha-ouro.jpg" Visible="False" />
                      </td>
                      <td style="width: 240px; font-size: small;">
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Nome") %>' />
                        <asp:HiddenField ID="hfCPF" runat="server" Value='<%# Bind("CPF") %>' />
                        <asp:HiddenField ID="hfFranquia" runat="server" Value='<%# Bind("Franquia") %>' />
                        <asp:HiddenField ID="hfNome" runat="server" Value='<%# Bind("Nome") %>' />
                      </td>
                      <td style="width: 180px; font-size: small;">
                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("Franquia") %>' />
                      </td>
                      <td style="width: 100px; font-size: small;">
                        <asp:Label ID="Label5" Font-Bold="true" runat="server" Text='<%# Bind("Pontos") %>' />
                      </td>
                    </tr>
                  </table>
                </HeaderTemplate>
                <ContentTemplate>
                  <asp:Panel ID="panMensagem" runat="server" Visible="False">
                    <table width="631px">
                      <tr>
                        <td style="width: 85px;" rowspan="3" valign="top">
                          <asp:ImageButton ID="img" runat="server" Height="80px" OnClick="VisualizarPerfil_Rankeado"
                            ImageUrl='<%# "~/imagens/avatar/" & Eval("Usuario.Avatar") %>' /><br />
                          <asp:LinkButton ID="lnkRankeado" runat="server" SkinID="lnkGridViewPequena" Text="Perfil"
                            OnClick="VisualizarPerfil_Rankeado"></asp:LinkButton>
                        </td>
                        <td style="font-size: small" colspan="2">
                          <asp:GridView ID="grvMensagens" runat="server" AutoGenerateColumns="False" Width="521px"
                            OnRowEditing="VisualizarPerfil_Remetente" BorderStyle="None" ShowHeader="False"
                            Style="font-size: x-small" OnDataBound="grvMensagens_DataBound" GridLines="None"
                            DataKeyNames="Id,Remetente" OnRowDeleting="grvMensagens_RowDeleting" >
                            <Columns>
                              <asp:TemplateField ItemStyle-Width="65px">
                                <ItemTemplate>
                                  <asp:ImageButton ID="imgRemetente" runat="server" Width="56px" CommandName="Edit"
                                    ImageUrl='<%# "~/imagens/avatar/" & IIF(Eval("UsuarioRemetente.Avatar")="", "sem_avatar.jpg", Eval("UsuarioRemetente.Avatar")) %>' />
                                </ItemTemplate>
                              </asp:TemplateField>
                              <asp:TemplateField ItemStyle-VerticalAlign="Top">
                                <ItemTemplate>
                                  <div style="float: left;">
                                    <strong>
                                      <asp:HiddenField ID="hdn_Remetente" runat="server" Value='<%# Eval("UsuarioRemetente.Usuario") %>' />
                                      <asp:LinkButton ID="Label3" runat="server" CommandName="Edit" Font-Size="11px" Font-Bold="true"
                                        Text='<%# Eval("UsuarioRemetente.Nome") %>' />:</strong>
                                  </div>
                                  <div style="float: right; width: 60px;">
                                    <asp:ImageButton ID="btnExcluir" runat="server" CommandName="Delete" ImageUrl="~/Imagens/btnExcluirIcone.png"
                                      Width="60px" Height="22px" />
                                  </div>
                                  <div style="float: right;">
                                    <strong>
                                      <%#Format(Eval("Data"), "dd/MM/yy")%>&nbsp;&nbsp;</strong>
                                  </div>
                                  <div style="clear: both" />
                                  <%#Eval("Mensagem").ToString().Replace("<", "&lt;").Replace(">", "&gt;").Replace(vbCr, "<br/>")%><br /><br />
                                </ItemTemplate>
                              </asp:TemplateField>
                            </Columns>
                          </asp:GridView>
                        </td>
                      </tr>
                      <tr>
                        <td style="font-size: small" colspan="2">
                          <b style="text-align: left">Enviar mensagem</b>
                        </td>
                      </tr>
                      <tr>
                        <td style="text-align: left">
                          <asp:TextBox ID="txtMensagem" runat="server" Height="81px" TextMode="MultiLine" Width="375px" />&nbsp;&nbsp;
                        </td>
                        <td valign="top">
                          <asp:Button ID="Button1" runat="server" CommandName="Delete" SkinID="btnPadrao" Text="Enviar"
                            Width="85px" OnClick="EnviarMensagem" />
                        </td>
                      </tr>
                    </table>
                  </asp:Panel>
                </ContentTemplate>
              </cc1:Accordion>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td style="width: 7px">
        &nbsp;
      </td>
      <td colspan="2">
        &nbsp;
      </td>
    </tr>
    <tr>
      <td style="width: 7px">
        &nbsp;
      </td>
      <td colspan="2">
      </td>
    </tr>
    <tr>
      <td style="width: 7px;">
        &nbsp;
      </td>
      <td>
      </td>
      <td>
        &nbsp;
      </td>
    </tr>
  </table>
</asp:Content>
